package shop.ynubeggar.model.dataobject;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import shop.ynubeggar.request.CreateBannerRequest;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author LiuQ
 * @since 2022-09-21
 */
@Data
@Builder
@EqualsAndHashCode(callSuper = false)
@TableName("banner")
@AllArgsConstructor
@NoArgsConstructor
public class BannerDO implements Serializable {

    private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 图片
     */
    private String img;

    /**
     * 跳转地址
     */
    private String url;

    /**
     * 权重
     */
    private Integer weight;


    public BannerDO(CreateBannerRequest createBannerRequest) {
        BeanUtil.copyProperties(createBannerRequest,this);
    }
}
